package com.ncmmall.mall.controller.business.subject;

import com.google.common.collect.ImmutableMap;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 公共页面资源
 *
 * @author likaikai
 * @date 2020-09-01 10:47:57
 */
@Controller
@RequestMapping("/mall/common/pages")
@Slf4j
public class CommonPagesController {

    /**
     * 公共页面资源
     */
    @RequestMapping(value = "/list", method = RequestMethod.GET)
    public String list(Model model) {

        List<Map<String, String>> list = new ArrayList<>();
        list.add(ImmutableMap.of("name", "首页", "url", "pages/tabBar/index/index"));
        list.add(ImmutableMap.of("name", "搜索结果页", "url", "pages/index/searchPage/searchPage?keyword={{搜索值}}"));
        list.add(ImmutableMap.of("name", "领劵中心页", "url", "page/my/pages/couponsCentre/couponsCentre"));
        list.add(ImmutableMap.of("name", "购物卡中心页", "url", "page/my/pages/shoppingCard/centre/centre"));
        list.add(ImmutableMap.of("name", "购物车页", "url", "pages/tabBar/cart/cart"));
        list.add(ImmutableMap.of("name", "分销商申请页", "url", "page/my/pages/applyButor/apply/apply"));
        list.add(ImmutableMap.of("name", "商家入驻页", "url", "pages/my/invite/create/create"));
        list.add(ImmutableMap.of("name", "秒杀列表页", "url", "pages/index/seckillZone/seckillZone"));
        list.add(ImmutableMap.of("name", "物价优惠列表页", "url", "pages/index/division/division?type=1&banner={{banner}}"));
        list.add(ImmutableMap.of("name", "预售专区列表页", "url", "pages/index/division/division?type=2&banner={{banner}}"));
        list.add(ImmutableMap.of("name", "拼团列表页", "url", "pages/index/division/division?type=3&banner={{banner}}"));

        model.addAttribute("list", list);

        return "mall/subjectActivity/common/pages";
    }

}
